<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../application/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="button" value="一次性修饰符" @click.once="oneTime()">
        <hr>
        <p>msg:{{msg}}</p>
        <textarea cols="10" rows="5" @keyup="msg=$event.target.value"></textarea>
        <textarea cols="10" rows="5" @keyup.Enter="msg=$event.target.value"></textarea>
        <textarea cols="10" rows="5" @keyup.13="msg=$event.target.value"></textarea>
        <textarea cols="10" rows="5" @keyup.13="setValue($event)"></textarea>
        <hr>
        <p>str:{{str}}</p>
        <textarea  cols="10" rows="5" @keyup.c.ctrl="copyFun($event)"></textarea>
        <textarea  cols="10" rows="5" @keyup.a.b.c="copyFun($event)"></textarea>
        <hr>
        <p>str1:{{str1}}</p>
        <input type="text" @keyup.left="str1=$event.target.value">
        <input type="text" @mouseup.left="str1=$event.target.value">
        <input type="text" @mouseup.right="str1=$event.target.value">
        <input type="text" @keyup.right="str1=$event.target.value">
        <input type="text" @mouseup.middle="str1=$event.target.value">
        <input type="text" @mousedown.left="str1=$event.target.value">
        <input type="text" @keydown.left="str1=$event.target.value">
        <input type="text" @mouseenter.left="str1=$event.target.value">
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                msg:"",
                str:"",
                str1:""
            },
            methods:{
                oneTime(){
                    console.log("这是一次性修饰符");
                },
                setValue(e){
                    // if(e.key=="Enter"){
                    //     this.msg=e.target.value;
                    // }
                    if(e.keyCode==13){
                        this.msg=e.target.value;
                    }
                },
                copyFun(e){
                    this.str=e.target.value;
                }
            }
        })
    </script>
</body>
</html>